package com.matt.foundation.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;

@Data
public class Body implements Serializable{

    @JsonProperty("t")
    private long timestamp = System.currentTimeMillis();

    @JsonProperty("o")
    private OrderEvent orderEvent;

    @JsonCreator
    public Body(@JsonProperty(value = "o", required = true) OrderEvent orderEvent) {
        this.orderEvent = orderEvent;
    }

    public long getTimestamp() {
        return timestamp;
    }


    @Override
    public String toString() {
        return "Body{" +
                "timestamp=" + timestamp +
                ", orderEvent=" + orderEvent +
                '}';
    }
}